package com.jpl.seminar.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.OneToMany;

@Entity
public class Registration implements Serializable {

	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE)
	private Long id;
	private String company;
	private String address;
	private String npaAndCity;
	private String country;
	private String phone;
	private String fax;

	@OneToMany(cascade = CascadeType.ALL)
	@JoinTable(name = "SEMINAR_PARTICIPANTS", joinColumns = @JoinColumn(name = "REGISTRATION_ID"), inverseJoinColumns = @JoinColumn(name = "PARTICIPANT_ID"))
	private List<Participant> participants = new ArrayList<Participant>();

	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public String getCompany() {
		return this.company;
	}

	public void setCompany(String company) {
		this.company = company;
	}

	public String getAddress() {
		return this.address;
	}

	public void setAddress(String address) {
		this.address = address;
	}

	public String getNpaAndCity() {
		return this.npaAndCity;
	}

	public void setNpaAndCity(String npaAndCity) {
		this.npaAndCity = npaAndCity;
	}

	public String getCountry() {
		return this.country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getPhone() {
		return this.phone;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getFax() {
		return this.fax;
	}

	public void setFax(String fax) {
		this.fax = fax;
	}

	public List<Participant> getParticipants() {
		return this.participants;
	}

	public void setParticipants(List<Participant> participants) {
		this.participants = participants;
	}

}